package com.zhiyou100.review.day005.port.demo.port;

/**
 * @packageName: CloneableTest
 * @className: com.zhiyou100.review.day005.port
 * @Description: TODO 接口可以做什么
 * @author: yang
 * @date: 6/13/20
 */
/*
public class CloneableTest implements Cloneable{
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public static void main(String[] args) throws CloneNotSupportedException {
        CloneableTest c1 = new CloneableTest();
        CloneableTest c2 = (CloneableTest)c1.clone();
        // 可以运行
    }
}
*/
public class CloneableTest {
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public static void main(String[] args) throws CloneNotSupportedException {
        CloneableTest c1 = new CloneableTest();
        CloneableTest c2 = (CloneableTest)c1.clone();
        // 抛出 java.lang.CloneNotSupportedException
    }
}
